import type { CallbackFunction } from "./types"

// Symbol key for marking once listeners
// 标记一次性监听的 Symbol
export const ONCES = Symbol('onces')

// Check if a function is registered as a once listener
// 判断一个函数是否被注册为一次性监听
export function isOnce(callback: CallbackFunction){
    return !!(callback as any)[ONCES]
}